#include <cstring>
#include <iomanip>
#include <ios>
#include <iostream>
#include <numeric>
#include <vector>
#include<cfloat>
using namespace std;
int main()
{
    int n;
    cin>>n;
    vector<int> phi(n+1);
    for(int i = 0;i<=n;i++)
    {
        phi[i] = i;
    }
    for(int i = 2;i<n;i++)
    {
        if(phi[i] == i)
        {
            phi[i] = i-1;//质数的互质数个数
            for(int k = 2*i;k<=n;k+=i)
            {
                phi[k] = phi[k]/i*(i-1);
            }
        }
    }
    double fmin = 1.0;
    for(int i = 2;i<=n;i++)
    {
        double tmp = static_cast<double>(phi[i])/i;
        if(tmp<fmin)
        {
            fmin = tmp;
        }
    }//计算所有小于等于n的数字的最简分数比
    cout<<fixed<<setprecision(6);
    cout<<fmin<<endl;
    return 0;
}